package com.qingkai.onlineshop.presentation.product

import androidx.compose.foundation.Image
import androidx.compose.foundation.clickable
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.material3.CenterAlignedTopAppBar
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.tooling.preview.Preview
import com.qingkai.onlineshop.R

/**
 *作者：created by 89270 on 2025/6/13 09:52
 *描述：
 */
@Preview(showBackground = true)
@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun ProductTopBar(title: String = "title", backPress: () -> Unit = {}) {
    CenterAlignedTopAppBar(
        navigationIcon = {
            Image(
                painterResource(id = R.drawable.back), contentDescription = "back",
                modifier = Modifier
                    .clip(CircleShape)
                    .clickable {
                        backPress.invoke()
                    })
        },
        title = {
            Text(text = title)
        })
}
